﻿Namespace db.prim

	Public Class bordro : Inherits table

		Property kimlik As New db.varchar
		Property isyerino As New db.varchar
		Property sno As New db.int
		Property bordro As New db.varchar
		Property bordrotar As New db.datetime
		Property donem As New db.int
		Property yil As New db.int
		Property pekt As New db.numeric
		Property pogst As New db.numeric
		Property prim As New db.numeric
		Property iscisay As New db.int
		Property primtahakkuk As New db.numeric
		Property geczam As New db.numeric
		Property faiz As New db.numeric
		Property tahsilatt As New db.numeric
		Property borc As New db.numeric
		Property makbuzno As New db.int
		Property sislem As New db.char
		Property tahsilattipi As New db.char
		Property islemtar As New db.datetime
		Property kaykul As New db.char
		Property alacak As New db.numeric
		Property primgen As New db.numeric
		Property tkcek As New db.int
		Property rowid As New db.bigint

		Property dagilim As New pgeneloran
		Property yatirimlar As New List(Of yatirim)
		Property problemliyatirimlar As New List(Of problemliyatirim)
		Property emanet As emanet

		Sub yeni(Token As Token)
			Token.BeginTran()
			InTransaction = True
			makbuzno.set(Token.OpenSQL("select numara from hesapnolar with (holdlock,tablockx) where hesapno = 3")(0))
			Token.ExecSQL("update hesapnolar set numara = numara+1 where hesapno = 3")
		End Sub

		Public Overrides ReadOnly Property tablename As String
			Get
				Return "pgenel"
			End Get
		End Property

		Public Overrides Sub AfterSave(Token As Token)
			dagilim.save(Token, False)
			For Each yatirim In yatirimlar
				yatirim.save(Token, False)
			Next
			For Each problemliyatirim In problemliyatirimlar
				problemliyatirim.save(Token, False)
			Next
			If Not emanet Is Nothing Then emanet.save(Token, False)
		End Sub

		Class pgeneloran : Inherits table

			Property makbuzno As New db.int
			Property shisse As New db.numeric
			Property isvhisse As New db.numeric
			Property devhisse As New db.numeric
			Property iks As New db.numeric
			Property ikisv As New db.numeric
			Property ikdev As New db.numeric
			Property iszs As New db.numeric
			Property iszisv As New db.numeric
			Property iszdev As New db.numeric
			Property hass As New db.numeric
			Property hasisv As New db.numeric
			Property hasdev As New db.numeric
			Property moys As New db.numeric
			Property moyisv As New db.numeric
			Property moydev As New db.numeric
			Property anas As New db.numeric
			Property anaisv As New db.numeric
			Property anadev As New db.numeric
			Property islemtar As New db.datetime
			Property kaykul As New db.char
			Property tkcek As New db.int
			Property rowid As New db.bigint

		End Class

		Class yatirim : Inherits table

			Property kimlik As New db.varchar
			Property pasaport As New db.varchar
			Property sno As New db.int
			Property isyerino As New db.char
			Property bordro As New db.varchar
			Property bordrotar As New db.datetime
			Property pek As New db.numeric
			Property pogs As New db.int
			Property makbuzno As New db.int
			Property kaykul As New db.char
			Property islemtar As New db.datetime
			Property taksit As New db.char
			Property rowid As New db.bigint

			Public Overrides ReadOnly Property tablename As String
				Get
					Return "shesk"
				End Get
			End Property

		End Class

		Class problemliyatirim : Inherits table

			Property kimlik As New db.varchar
			Property pasaport As New db.varchar
			Property sno As New db.int
			Property adi As New db.varchar
			Property soyadi As New db.varchar
			Property isyerino As New db.char
			Property bordro As New db.varchar
			Property bordrotar As New db.datetime
			Property pek As New db.numeric
			Property pogs As New db.int
			Property makbuzno As New db.int
			Property kaykul As New db.char
			Property islemtar As New db.datetime
			Property taksit As New db.char
			Property rowid As New db.bigint

			Public Overrides ReadOnly Property tablename As String
				Get
					Return "sheskp"
				End Get
			End Property

		End Class

	End Class

End Namespace
